Repository navigation
test(xsender): the extensions' integration tests answer with a fake SUNAT - #249
Merged
Merged
Conversation
…UNAT The Quarkus and Spring Boot integration tests sent their files to SUNAT beta, so CI failed whenever beta did: today it answers every comunicación de baja with 0135 "No se pudo encolar el pedido" (a fresh one too), and main went red with no code change involved. They test the extensions' wiring (configuration -> XSender -> core -> an answer), so they now send to a local fake billService that answers sendBill with a CDR and sendSummary with a ticket, from the canned answers of xsender's core tests. The Quarkus tests point the extension at it with a test resource, which also covers the native @QuarkusIntegrationTest; the Spring Boot test with @DynamicPropertySource. The voided document test now checks the ticket itself, not just that there is one. SUNAT beta stays covered on demand by xsender's SunatBetaTest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on main is red with no code change involved:
quarkus-extension (xsender),quarkus-supported-v (3.33.4.2)andxsender-springboot-extensionall fail insendVoidedDocument.These integration tests sent their files to SUNAT beta. Today beta answers every comunicación de baja (
sendSummary) with:I reproduced this outside CI three ways: with the test's fixture, with a freshly signed RA dated today, and with one rebuilt with the 2020 date. Facturas (
sendBill) are still accepted. So beta's ticket queue is down, and a re-run of the jobs failed the same way. The test resource then turned the fault into a 500 (getSunat()is null for a fault).What
These tests check the extensions' wiring (configuration → XSender → core → an answer). They now send to a local fake billService instead of SUNAT beta:
FakeSunat, one per IT module. It answerssendBillwith a CDR andsendSummarywith a ticket, using the canned answers of xsender core's tests. Any other action gets a 500.FakeSunatResourcetest resource pointsquarkus.xsender.company.invoice-urlat the fake. It's on both the@QuarkusTestand the native@QuarkusIntegrationTest, because@WithTestResourceisn't inherited. In native mode, the override reaches the binary as a system property.@DynamicPropertySource.SUNAT beta stays covered on demand by xsender's
SunatBetaTest.Verified
GACT cannot be cast to Comparableerror. It builds in CI. Its API was checked:@WithTestResourceexists there and behaves the same. This PR's CI covers it, together with the native builds.Senior review
Two passes. Findings applied:
🤖 Generated with Claude Code